import { h } from 'vue';
import { NTag } from 'naive-ui';

export const columns = [
  {
    title: 'ID',
    key: 'id',
    width: 30,
  },
  {
    title: '交易名称',
    key: 'subject',
    width: 30,
  },
  {
    title: '用户ID',
    key: 'userId',
    width: 30,
  },
  {
    title: '交易凭证',
    key: 'tradeNo',
    width: 80,
  },
  {
    title: '交易状态',
    key: 'tradeStatus',
    width: 30,
    render(row) {
      if (row.tradeStatus == '已支付') {
        return h(
          NTag,
          {
            style: {
              marginRight: '6px',
            },
            type: 'info',
            bordered: false,
          },
          {
            default: () => '已支付',
          }
        );
      } else {
        return h(
          NTag,
          {
            style: {
              marginRight: '6px',
            },
            type: 'info',
            bordered: false,
          },
          {
            default: () => '普通用户',
          }
        );
      }
    },
  },
  {
    title: '商户订单号',
    key: 'outTradeNo',
    width: 30,
  },
  {
    title: '交易金额',
    key: 'totalAmount',
    width: 30,
  },
  {
    title: '支付宝ID',
    key: 'buyerId',
    width: 80,
  },
  {
    title: '付款时间',
    key: 'gmtPayment',
    width: 50,
  },
  {
    title: '买家付款金额',
    key: 'buyerPayAmount',
    width: 40,
  },
];
